import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;


public class ejbStatefulSessionBeanClient  {
	
	public static void main (String[] args) throws NamingException {
		Context ejbContext = ejbStatefulSessionBeanClient.getIntialContext();
		EJBStatefulSessionBeanRemote myejbStatefulSessionBeanRemote = (EJBStatefulSessionBeanRemote) ejbContext.lookup("EJBStatefulSessionBean/remote");
		myejbStatefulSessionBeanRemote.ejbStatefulSessionBeanMethod();
		
	}
	
	public static Context getIntialContext() throws NamingException{
		
		Properties ejbProperties = new Properties();
		ejbProperties.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
		ejbProperties.setProperty("java.naming.factory.url.pkgs","org.jboss.naming");
		ejbProperties.setProperty("java.naming.provider.url","127.0.0.1:1099");
		return new InitialContext(ejbProperties);
		
	}

}
